package file;

import java.io.File;
import java.io.IOException;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        for (int i = 1; i <= 50; i++) {
            File dir = new File("./demo"+i);
            if (!dir.exists()){
                dir.mkdirs();
                System.out.println("目录已创建");
            }else{

                System.out.println("目录已存在");
            }
            for (int j = 1; j <= 100; j++) {
                File test = new File(dir,"test"+j+".txt");
                if (!test.exists()){
                    test.createNewFile();
                    System.out.println("文件已创建");
                }else{

                    System.out.println("文件已存在");
                }
            }
        }
    }
}
